package com.jinzhi.jzweb.controller;

import com.jinzhi.common.utils.Result;
import com.jinzhi.jzweb.domain.ExaminationResultsComDO;
import com.jinzhi.jzweb.pojo.VtatisticsVo;
import com.jinzhi.jzweb.strategy.factory.PayStrategyFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/*
 *  @author : JingChangTian
 *  @date   : 2023/6/5 14:18
 *  @description : 赛场得分统计
 *
 */
@Controller
@RequestMapping("/jzweb/SheetComBSour")
@Api(value = "教师组竞赛平台", tags = {"赛场得分统计"})
public class ExaminationSourController {

    private final PayStrategyFactory payStrategyFactory;

    public ExaminationSourController(PayStrategyFactory payStrategyFactory) {
        this.payStrategyFactory = payStrategyFactory;
    }

    @ApiOperation(value = "赛场统计", notes = "赛场统计")
    @RequestMapping(value = "/list", method = RequestMethod.POST ,produces = "application/json")
    @ResponseBody
    public Result<VtatisticsVo> getSour(@RequestBody ExaminationResultsComDO examinationAnswerSheetComDTO) throws Exception {
        return payStrategyFactory.get(examinationAnswerSheetComDTO.getAbc()).list(examinationAnswerSheetComDTO);
    }
}
